<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>list</title>
</head>
<body>
    <div style="width: 500px;">
        <div style="width: 100%;">
            <div style="float: left">
                <form th:action="@{/list}" method="post">
                    请输入关键字：
                    <input type="text" name="keyword" th:value="${session.keyword}">
                    <input type="hidden" name="oper" value="search">
                    <input type="submit" value="查询">
                </form>
            </div>
            <div style="float: right;">
                <a th:href="@{/add.html}">添加演员</a>
            </div>
        </div>
        <div>
            <table border="1" cellpadding="0" cellspacing="0">
                <tr>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>出生年月</th>
                    <th>电话</th>
                    <th>操作</th>
                </tr>
                <tr th:if="${#lists.isEmpty(session.actorList)}">
                    <td colspan="5">数据为空</td>
                </tr>
                <tr th:unless="${#lists.isEmpty(session.actorList)}" th:each="actor : ${session.actorList}">
                    <td th:text="${actor.name}"></td>
                    <td th:text="${actor.sex}"></td>
                    <td th:text="${actor.borndate}"></td>
                    <td th:text="${actor.phone}"></td>
                    <td>
                        <a th:href="@{/edit.do(id=${actor.id})}">编辑</a>
                        <span th:onclick="|del(${actor.id})|">删除</span>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <span><input type="button" value="首页" onclick="page(1)" th:disabled = "${session.currentPageNo == 1}"></span>
            <span><input type="button" value="上一页" th:onclick="|page(${session.currentPageNo - 1})|" th:disabled = "${session.currentPageNo == 1}"></span>
            <span><input type="button" value="下一页" th:onclick="|page(${session.currentPageNo + 1})|" th:disabled = "${session.currentPageNo == session.totalPageNo}"></span>
            <span><input type="button" value="尾页" th:onclick="|page(${session.totalPageNo})|" th:disabled = "${session.currentPageNo == session.totalPageNo}"></span>
        </div>
    </div>
</body>
<script src="js/list.js"></script>
</html>